<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.16"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>ClaraGenomicsAnalysis: Clara Genomics Analysis</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">ClaraGenomicsAnalysis
   &#160;<span id="projectnumber">0.4.0</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.16 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
</div><!-- top -->
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="PageDoc"><div class="header">
  <div class="headertitle">
<div class="title">Clara Genomics Analysis </div>  </div>
</div><!--header-->
<div class="contents">
<div class="textblock"><h1><a class="anchor" id="autotoc_md1"></a>
Overview</h1>
<p>Clara Genomics Analysis is a GPU-accelerated library for biological sequence analysis. This section provides a brief overview of the different components of ClaraGenomicsAnalysis. For more detailed API documentation please refer to the <a href="#enable-doc-generation">documentation</a>.</p>
<h2><a class="anchor" id="autotoc_md2"></a>
cudapoa</h2>
<p>The <code>cudapoa</code> package provides a GPU-accelerated implementation of the <a href="https://simpsonlab.github.io/2015/05/01/understanding-poa/">Partial Order Alignment</a> algorithm. It is heavily influenced by <a href="https://github.com/rvaser/spoa">SPOA</a> and in many cases can be considered a GPU-accelerated replacement. Features include:</p>
<ol type="1">
<li>Generation of consensus sequences</li>
<li>Generation of multi-sequence alignments (MSAs)</li>
</ol>
<h2><a class="anchor" id="autotoc_md3"></a>
cudaaligner</h2>
<p>The <code>cudaaligner</code> package provides GPU-accelerated global alignment.</p>
<h2><a class="anchor" id="autotoc_md4"></a>
cudamapper</h2>
<p><b>Note</b> cudamapper is still in pre-alpha stage and should be considered experimental.</p>
<p>The <code>cudamapper</code> package provides minimizer-based GPU-accelerated approximate mapping. <code>cudamapper</code> outputs mappings in the PAF format and is currently optimised for all-vs-all long read (ONT, Pacific Biosciences) sequences.</p>
<p>To run all-vs all overlaps use the following command:</p>
<p><code>cudamapper in.fasta in.fasta</code></p>
<p>A query fasta can be mapped to a reference as follows:</p>
<p><code>cudamapper query.fasta target.fasta</code></p>
<h3><a class="anchor" id="autotoc_md5"></a>
cudamapper usage information</h3>
<p>To access more information about running cudamapper, run <code>cudamapper --help</code>.</p>
<h1><a class="anchor" id="autotoc_md6"></a>
Clone Clara Genomics Analysis</h1>
<h2><a class="anchor" id="autotoc_md7"></a>
Latest released version</h2>
<p>This will clone the repo to the <code>master</code> branch, which contains code for latest released version and hot-fixes.</p>
<div class="fragment"><div class="line">git clone --recursive -b master git@github.com:clara-genomics/ClaraGenomicsAnalysis.git</div>
</div><!-- fragment --><h2><a class="anchor" id="autotoc_md8"></a>
Latest development version</h2>
<p>This will clone the repo to the default branch, which is set to be the latest development branch. This branch is subject to change frequently as features and bug fixes are pushed.</p>
<div class="fragment"><div class="line">git clone --recursive git@github.com:clara-genomics/ClaraGenomicsAnalysis.git</div>
</div><!-- fragment --><h1><a class="anchor" id="autotoc_md9"></a>
System Requirements</h1>
<p>Minimum requirements -</p>
<ol type="1">
<li>Ubuntu 16.04 or Ubuntu 18.04</li>
<li>CUDA 9.0+</li>
<li>gcc/g++ 5.4.0+</li>
<li>Python 3.6.7+</li>
<li>htslib 1.9+ (<a href="https://github.com/samtools/htslib,">https://github.com/samtools/htslib,</a> also requires <code>zlib1g-dev</code>, <code>libbz2-dev</code> and <code>liblzma-dev</code> to be installed on Ubuntu)</li>
</ol>
<h1><a class="anchor" id="autotoc_md10"></a>
Clara Genomics Analysis Setup</h1>
<h2><a class="anchor" id="autotoc_md11"></a>
Build</h2>
<p>To build Clara Genomics Analysis -</p>
<div class="fragment"><div class="line">mkdir build</div>
<div class="line">cd build</div>
<div class="line">cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=install</div>
<div class="line">make -j install</div>
</div><!-- fragment --><h2><a class="anchor" id="autotoc_md12"></a>
Install</h2>
<p>To install the SDK -</p>
<div class="fragment"><div class="line">make install</div>
</div><!-- fragment --><h2><a class="anchor" id="autotoc_md13"></a>
Package generation</h2>
<p>Package generation puts the libraries, headers and binaries built by the <code>make</code> command above into a <code>.deb</code>/<code>.rpm</code> for portability and easy installation. The package generation itself doesn't guarantee any cross-platform compatibility.</p>
<p>It is recommended that a separate build and packaging be performed for each distribution and CUDA version that needs to be supported.</p>
<p>The type of package (deb vs rpm) is determined automatically based on the platform the code is being run on. To generate a package for the SDK -</p>
<div class="fragment"><div class="line">make package</div>
</div><!-- fragment --><h1><a class="anchor" id="autotoc_md14"></a>
Enable Unit Tests</h1>
<p>To enable unit tests, add <code>-Dcga_enable_tests=ON</code> to the <code>cmake</code> command in the build step.</p>
<p>This builds GTest based unit tests for all applicable modules, and installs them under <code>${CMAKE_INSTALL_PREFIX}/tests</code>. These tests are standalone binaries and can be executed directly. e.g.</p>
<div class="fragment"><div class="line">cd $INSTALL_DIR</div>
<div class="line">./tests/cudapoatests</div>
</div><!-- fragment --><h1><a class="anchor" id="autotoc_md15"></a>
Enable Benchmarks</h1>
<p>To enable benchmarks, add <code>-Dcga_enable_benchmarks=ON</code> to the <code>cmake</code> command in the build step.</p>
<p>This builds Google Benchmark based microbenchmarks for applicable modules. The built benchmarks are installed under <code>${CMAKE_INSTALL_PREFIX}/benchmarks/&lt;module&gt;</code> and can be run directly.</p>
<p>e.g. </p><div class="fragment"><div class="line">#INSTALL_DIR/benchmarks/cudapoa/multibatch</div>
</div><!-- fragment --><p>A description of each of the benchmarks is present in a README under the module's benchmark folder.</p>
<h1><a class="anchor" id="autotoc_md16"></a>
Enable Doc Generation</h1>
<p>To enable document generation for Clara Genomics Analysis, please install <code>Doxygen</code> on your system. Once<code>Doxygen</code> has been installed, run the following to build documents.</p>
<div class="fragment"><div class="line">make docs</div>
</div><!-- fragment --><p>Docs are also generated as part of the default <code>all</code> target when <code>Doxygen</code> is available on the system.</p>
<p>To disable documentation generation add <code>-Dcga_generate_docs=OFF</code> to the <code>cmake</code> command in the <a href="#build">build step</a>.</p>
<h1><a class="anchor" id="autotoc_md17"></a>
Code Formatting</h1>
<h2><a class="anchor" id="autotoc_md18"></a>
C++ / CUDA</h2>
<p>Clara Genomics Analysis makes use of <code>clang-format</code> to format it's source and header files. To make use of auto-formatting, <code>clang-format</code> would have to be installed from the LLVM package (for latest builds, best to refer to <a href="http://releases.llvm.org/download.html">http://releases.llvm.org/download.html</a>).</p>
<p>Once <code>clang-format</code> has been installed, make sure the binary is in your path.</p>
<p>To add a folder to the auto-formatting list, use the macro <code>cga_enable_auto_formatting(FOLDER)</code>. This will add all cpp source/header files to the formatting list.</p>
<p>To auto-format, run the following in your build directory.</p>
<div class="fragment"><div class="line">make format</div>
</div><!-- fragment --><p>To check if files are correct formatted, run the following in your build directory.</p>
<div class="fragment"><div class="line">make check-format</div>
</div><!-- fragment --><h2><a class="anchor" id="autotoc_md19"></a>
Python</h2>
<p>Clara Genomics Analysis follows the PEP-8 style guidelines for all its Python code. The automated CI system for Clara Genomics Analysis run <code>flake8</code> to check the style.</p>
<p>To run style check manually, simply run the following from the top level folder. </p><div class="fragment"><div class="line">flake8 pyclaragenomics/</div>
</div><!-- fragment --><h1><a class="anchor" id="autotoc_md20"></a>
Running CI Tests Locally</h1>
<p>Please note, your git repository will be mounted to the container, any untracked files will be removed from it. Before executing the CI locally, stash or add them to the index.</p>
<p>Requirements:</p><ol type="1">
<li>docker (<a href="https://docs.docker.com/install/linux/docker-ce/ubuntu/">https://docs.docker.com/install/linux/docker-ce/ubuntu/</a>)</li>
<li>nvidia-docker (<a href="https://github.com/NVIDIA/nvidia-docker">https://github.com/NVIDIA/nvidia-docker</a>)</li>
<li>nvidia-container-runtime (<a href="https://github.com/NVIDIA/nvidia-container-runtime">https://github.com/NVIDIA/nvidia-container-runtime</a>)</li>
</ol>
<p>Run the following command to execute the CI build steps inside a container locally: </p><div class="fragment"><div class="line">bash ci/local/build.sh -r &lt;ClaraGenomicsAnalysis repo path&gt;</div>
</div><!-- fragment --><p> ci/local/build.sh script was adapted from <a href="https://github.com/rapidsai/cudf/tree/branch-0.11/ci/local">rapidsai/cudf</a></p>
<p>The default docker image is <b>clara-genomics-base:cuda10.0-ubuntu16.04-gcc5-py3.7</b>. Other images from <a href="https://hub.docker.com/r/gpuci/clara-genomics-base/tags">gpuci/clara-genomics-base</a> repository can be used instead, by using -i argument </p><div class="fragment"><div class="line">bash ci/local/build.sh -r &lt;ClaraGenomicsAnalysis repo path&gt; -i gpuci/clara-genomics-base:cuda10.0-ubuntu18.04-gcc7-py3.6</div>
</div><!-- fragment --> </div></div><!-- PageDoc -->
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.16
</small></address>
</body>
</html>
